package com.chen.staffjoy.company.controller;

import com.chen.staffjoy.commonlib.base.BaseController;
import com.chen.staffjoy.company.entity.Company;
import com.chen.staffjoy.company.service.ICompanyService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 企业信息表 Controller
 *
 * @author ChenTian
 */ 
@RestController
@RequestMapping("/company")
public class CompanyController extends BaseController {

	@Resource
	private ICompanyService companyService;

	@GetMapping("/getById/{id}")
	public Company getById(@PathVariable String id) {
		Company result = companyService.findById(id);
		return result;
	}

	@DeleteMapping("/deleteById/{id}")
	public void deleteById(@PathVariable String id) {
		companyService.deleteById(id);
	}

	@PostMapping("/save")
	public Company save(@RequestBody Company model) {
		Company result = companyService.save(model);
		return result;
	}

}
